home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.004 / FGUSER20.TXT < prev    next >
Text File  |  1995-05-29  |  15KB  |  406 lines

  1.                                System Hardware
  2.  
  3.                                      "People find gold in fields, veins,
  4.                                       river beds and pockets. Whichever,
  5.                                       it takes a lot of work to get it
  6.                                       out."
  7.                                                    Art Linkletter   1965
  8.  
  9. Introduction
  10.  
  11.           Several areas of "the system" are covered in this chapter,
  12.      specifically, the equipment, the memory, and the operating system.
  13.      The equipment routines return information about the peripheral
  14.      devices installed on the computer. The memory routines provide
  15.      information about conventional, extended, and expanded memory and
  16.      lastly the operating system routines provide information about, you
  17.      guessed it, the operating system and the DOS configurable
  18.      international settings.
  19.  
  20. Determining System Hardware
  21.  
  22. Disk Drives
  23.  
  24.      ParallelPorts: byte;
  25.  
  26.      Returns the number of installed parallel ports (LPTx).
  27.  
  28.      SerialPorts: byte;
  29.  
  30.      Returns the number of installed serial ports (COMx).
  31.  
  32.      FloppyDrives: byte;
  33.  
  34.           Returns the number of floppy drives physically installed on
  35.      the system.
  36.  
  37.      LastDrv: integer;
  38.  
  39.           Beginning with DOS V3, this function returns a minimum last
  40.      drive value equal to the number of logical drives or the LASTDRIVE
  41.      value from the CONFIG.SYS file, whichever is greater. If there are
  42.      only three logical drives and CONFIG.SYS does not specify a
  43.      LASTDRIVE value, the default LASTDRIVE value of 5 is returned. If
  44.      you need to determine the number of physical floppy drives attached
  45.      to the system, use the function FloppyDrives, which returns this
  46.      byte value.
  47.  
  48.      LogicalDriveNum( Drive: char ): byte;
  49.  
  50.           Converts a drive character to its logical drive equivalent.
  51.      Drives A to Z are supported. (i.e. A = 0, B = 1, C = 2, ... )
  52.  
  53.      PhysicalDriveNum( Drive: char ): byte;
  54.  
  55.           Converts a drive character to its physical drive equivalent.
  56.      Drives A to Z are supported. (i.e. A = 1, B = 2, C = 3, ... )
  57.  
  58.      DriveChar( Drive: byte ): char;
  59.  
  60.           Converts a byte value indicating  the drive to be converted to
  61.      its character equivalent. Byte values ranging from 0 to 26 are
  62.      supported. (i.e. 0 = default, 1 = A, 2 = B, 3 = C, ...)
  63.  
  64.      IsPhantom: boolean;
  65.  
  66.           Since DOS will allow a user to switch to drive B whether or
  67.      not it exists, it always looks more professional to a user to read
  68.      a great PromptOK message about the drive not existing, rather than
  69.      the infamous: INSERT DISKETTE IN DRIVE B: AND PRESS ENTER blasted
  70.      across your custom designed screen.
  71.  
  72.      SetDriveTo( Drive: byte );
  73.  
  74.      Eliminates "Insert diskette in drive" message.
  75.  
  76.      DriveExists(Drive: char): boolean;
  77.  
  78.           This is the preferred method of determining a drive's
  79.      existence since it incorporates IsPhantom as a part of the
  80.      determination. This function returns true if the specified drive
  81.      physically exists.
  82.  
  83.      DriveIsReady( Drive: byte ): boolean;
  84.  
  85.           Returns true when the specified drive contains a correctly
  86.      formatted readable diskette. This function actually looks at
  87.      (seeks) the drive before making its determination, which is
  88.      different from other related routines which make their
  89.      determination by reading information contained in memory.
  90.  
  91.      CurrentDriveByte: byte;
  92.  
  93.      Returns a byte value of the current physical drive.
  94.  
  95.      CurrentDriveChar: char;
  96.  
  97.      Returns the character equivalent of the physical drive.
  98.  
  99.      CurrentPathStr: DirStr;
  100.  
  101.           Returns a string representing the current path on the current
  102.      drive. This string excludes the final backslash.
  103.  
  104.      SetCurrentPath( NewPath: PathStr ): boolean;
  105.  
  106.           Returns a true value if the routine successfully changes to
  107.      the path specified.
  108.  
  109.      ValidPath( Path: PathStr ): boolean;
  110.  
  111.      Returns true if the path specified is a valid path.
  112.  
  113. Miscellaneous Display Routines
  114.  
  115.           Previous versions of the toolkit contained several routines
  116.      that covered the display equipment within the Hardware unit. Due to
  117.      the enhancements and methods of attaining information (and speed)
  118.      most of these routines have been moved to the GOLDFAST unit.
  119.      However, these remain simply because of how the information is
  120.      retrieved.
  121.  
  122.      GetDispMode: byte;
  123.  
  124.           Returns the current display mode, e.g. mode 3 is 80 column
  125.      mode. Refer to the Pascal Programmers Guide or a DOS Technical
  126.      Reference for more information about display modes.
  127.  
  128.      ColorScreen: boolean;
  129.  
  130.           Returns true if the system is capable of supporting a color
  131.      display. This function is normally called to determine whether to
  132.      use monochrome or color attributes when overriding the toolkit's
  133.      defaults. This function will always return false if
  134.      HardVars.ForceBW is set to true. It also returns false if the user
  135.      is using a color system, but has set the device to BW80 mode.
  136.  
  137. Media Serial Numbers
  138.  
  139.           Beginning with DOS 4.0, any media being formatted has a serial
  140.      number written to it. This serial number is a longint value
  141.      contained in the Boot Parameter Block (BPB). If you inspect the
  142.      very first piece of a diskette, you can actually pick it out by
  143.      counting backwards 8 bytes from the beginning of the volume label.
  144.      This will be the first byte of the serial number.
  145.  
  146.           The serial number, if placed by the FORMAT program, is a
  147.      unique value made up of the system date and time. You may retrieve
  148.      or modify this serial number to your liking by using the following
  149.      two functions:
  150.  
  151.      GetMediaSerialNumber( Drive: byte ): string;
  152.  
  153.           Returns a string representing the serial number placed on the
  154.      designated drive. The drive byte is passed as a physical value,
  155.      i.e. 0 = default drive, 1 = A, 2 = B, ...
  156.  
  157.      SetMediaSerialNumber( Drive: byte;Serial: longint ): boolean;
  158.  
  159.           Although the proper way to set the serial number on a floppy
  160.      or fixed disk is to format the disk, it may be set manually using
  161.      this function. The longint value passed is converted to its
  162.      hexadecimal representation and written to disk.
  163.  
  164.      An example of setting the serial number might look like this:
  165.  
  166.      Success := SetMediaSerialNumber(0, HEXStrToLong('01020304'));
  167.  
  168. The Volume Label
  169.  
  170.           The volume label is actually stored in two places: the Boot
  171.      Parameter Block (BPB) as an array of eleven bytes; also, as a file
  172.      name entry but with the attribute assignment indicating that it is
  173.      a volume label. DOS handles making the appropriate changes.
  174.  
  175.      GetVolumeLabel( Drive: byte ): string;
  176.  
  177.           Returns a string representing the volume label of the Drive
  178.      designated.
  179.  
  180.      SetVolumeLabel( Drive: byte; LabelStr: Str12 ): byte;
  181.  
  182.      Writes a new volume label to the designated drive.
  183.  
  184.      DeleteVolumeLabel( Drive: byte ): byte;
  185.  
  186.      Removes the volume label from the designated drive.
  187.  
  188.      MediaIsLabeled( Drive: byte ): boolean;
  189.  
  190.      Returns true if a volume label is located on the designated drive.
  191.  
  192.      LabelIsCorrect( Drive: byte; LabelName: string ): LabelStatus;
  193.  
  194.           Compares the volume label specified to the volume label on the
  195.      specified  drive and returns a label status. LabelStatus is
  196.      declared as an enumerated type that contains three members,
  197.      CorrectLabel, NoLabel, IncorrectLabel. This can be used to check or
  198.      validate volume labels for various reasons.
  199.  
  200. System Specific
  201.  
  202.      OSVersion(Major:boolean): byte;
  203.  
  204.           If Major is a true value, then the major DOS version number,
  205.      e.g. 3, 4, 5 or 6 is returned, otherwise the minor DOS version
  206.      number is returned.
  207.  
  208.      OSVersionStr: string;
  209.  
  210.      Returns a full DOS version number, e.g. "6.22".
  211.  
  212.      ComputerID: byte;
  213.  
  214.           This function returns a byte indicating the basic system type.
  215.      The computer ID was implemented by IBM to provide an easy way for
  216.      differentiating between the various IBM personal computers. The
  217.      following list shows the hexadecimal values of the IBM range:
  218.  
  219.  
  220.           $FF       - IBM PC
  221.           $FE,$FB   - IBM XT or portable
  222.           $FD       - the infamous PC Junior
  223.           $FC       - IBM AT, XT-286, PS/2 50 and 60
  224.           $FA       - PS/2 25 and 30
  225.           $F9       - IBM PC Convertible
  226.           $F8       - PS/2 80
  227.  
  228.           Some non-IBM systems do not follow this convention, an
  229.      unlisted number may be returned by this method.
  230.  
  231.      ROMDate: string;
  232.  
  233.           Returns an eight character string representing the ROM date in
  234.      the format MM/DD/YY.
  235.  
  236.      GameAdapter: boolean;
  237.  
  238.      Returns true if a game adapter is installed.
  239.  
  240.      SerialPrinter: boolean;
  241.  
  242.      Returns true if a serial printer is configured.
  243.  
  244.      MathChip: boolean;
  245.  
  246.           Returns true if a math co-processor is detected. If you
  247.      compile toolkit programs with the compiler directive FLOAT enabled,
  248.      but FLOATEM disabled, the program will only run on systems equipped
  249.      with a math co-processor. Use this function during program
  250.      initialization to ensure the host PC is adequately equipped.
  251.  
  252.      OSVersionMajor: byte;
  253.  
  254.      Returns the major DOS version number, e.g. 3, 4, 5 or 6.
  255.  
  256.      OSVersionMinor: byte;
  257.  
  258.      Returns the minor DOS version number, e.g. 1.
  259.  
  260.      Country: word;
  261.  
  262.           Returns a word which represents the country code. In general,
  263.      the country codes are the same as the 3-digit international phone
  264.      access code. Some of the common codes are:
  265.  
  266.           001  United States
  267.           002  Canada (French)
  268.           003  Latin America
  269.           031  Netherlands
  270.           032  Belgium
  271.           033  France
  272.           034  Spain
  273.           039  Italy
  274.           041  Switzerland
  275.           044  United Kingdom
  276.           045  Denmark
  277.           046  Sweden
  278.           047  Norway
  279.           049  Germany
  280.           061  Australia
  281.           351  Portugal
  282.           358  Finland
  283.  
  284.      Currency: string;
  285.  
  286.           Returns a string identifying the country's currency
  287.      abbreviation. On systems using DOS prior to version 3.0, only a
  288.      single character can be accessed. However, systems using DOS 3.0
  289.      and later may return more than one character, e.g. FFR, DKR.
  290.  
  291.      DateFmt: OSDate;
  292.  
  293.           Returns the gDate enumerated type member which represents the
  294.      operating system default date format. The GOLDHARD unit includes
  295.      the enumerated type gDate which has three members: USA, EUROPE, and
  296.      JAPAN.
  297.  
  298.           The three formats are MM-DD-YY, DD-MM-YY, and YY-MM-DD,
  299.      respectively.
  300.  
  301.      ThousandsSep: char;
  302.  
  303.           Returns the character used to punctuate the thousands mark in
  304.      numbers. The USA uses a comma, whereas some other countries use a
  305.      period or a space.
  306.  
  307.      DecimalSep: char;
  308.  
  309.           Returns the character used to punctuate the decimal place.
  310.      This is usually a period or a comma.
  311.  
  312.      DateSep: char;
  313.  
  314.           Returns the character used to separate the month, day, and
  315.      year elements of a date. This information is not available on
  316.      systems using DOS versions less than 3.0.  If this information is
  317.      not available a '/' is returned.
  318.  
  319.      TimeSep: char;
  320.  
  321.           Returns the character used to separate the hours, minutes and
  322.      seconds when displaying the time.
  323.  
  324.           This information is not accessible on systems using DOS prior
  325.      to version 3.0. If the machine does not have DOS 3.0 or later, a 0
  326.      is returned.
  327.  
  328.      TimeFmt: byte;
  329.  
  330.           Returns a byte to indicate the preferred time display. A 0
  331.      indicates a 12 hour format, and a 1 indicates a 24 hour format.
  332.  
  333.           This information is not accessible on systems using DOS prior
  334.      to version 3.0. If the machine does not have DOS 3.0 or later, a 0
  335.      is returned.
  336.  
  337.      CurrencyFmt: byte;
  338.  
  339.           Returns a byte indicating the currency format. One of the
  340.      following five values will be returned:
  341.  
  342.           0    String leads currency, no space
  343.           1    String follows currency, no space
  344.           2    String leads currency, one space
  345.           3    String follows currency, one space
  346.           4    String replaces decimal separator
  347.  
  348.      NOTE:
  349.           This information is not accessible on systems using DOS prior
  350.      to version 3.0. If the machine does not have DOS 3.0 or later, a 0
  351.      is returned.
  352.  
  353.      CurrencyDecPlaces: byte;
  354.  
  355.           Returns the number of decimal places normally used with the
  356.      country's currency.
  357.  
  358.           This information is not accessible on systems using DOS prior
  359.      to version 3.0. If the machine does not have DOS 3.0 or later, a 2
  360.      is returned.
  361.  
  362. Memory Specific
  363.  
  364.      BaseMemory: integer;
  365.  
  366.           Returns the total amount of base memory installed, i.e. memory
  367.      up to 640K. The value is returned in kilobytes ("k"). Remember to
  368.      use the other toolkit functions GoldMemAvail and GoldMaxAvail to
  369.      provide data on free memory, i.e. memory not being used by device
  370.      drivers and programs.
  371.  
  372.      EMMInstalled: boolean;
  373.  
  374.      Returns true if an expanded memory manager is installed.
  375.  
  376.      XMSInstalled: boolean;
  377.  
  378.      Returns true if an extended memory driver is installed.
  379.  
  380.      EMMVersionMajor: byte;
  381.  
  382.           Returns the expanded memory manager major version number, i.e.
  383.      the whole portion of the version number. If an EMM is not
  384.      installed, a 0 is returned.
  385.  
  386.      EMMVersionMinor: byte;
  387.  
  388.           Returns the expanded memory manager minor version number, i.e.
  389.      the decimal portion of the version number. If an EMM is not
  390.      installed, or if the minor version number is a zero, a 0 is
  391.      returned.
  392.  
  393.      EMMVersion: string;
  394.  
  395.           Returns a three character string representing the complete EMM
  396.      version number, e.g. "4.0".
  397.  
  398. Encountering and Determining Errors
  399.  
  400.      LastHardError: integer;
  401.  
  402.           Returns the integer value of the last error that was detected
  403.      in the GOLDHARD unit.  A value of zero indicates no errors have
  404.      been detected.
  405.  
  406.